package org.hxzon.demo.jacob;

import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;

public class JacobDemo1 {

    public static void main(String args[]) {
        ActiveXComponent acx = new ActiveXComponent("ETaxCertSvr.CertService");
        Variant var = acx.invoke("GetCertAttributes");
        String result = var.getString();
        System.out.println(result);

        ActiveXComponent acx2 = new ActiveXComponent("UKEYINVOKER.UkeyInvokerCtrl.1");
        Variant var2 = acx2.invoke("readData");
        String result2 = var2.getString();
        System.out.println(result2);
        //acx2.invoke("setKey","oldPassword","");
//        acx2.invoke("removeData");
//        acx2.invoke("writeData","write toDay"+new Date());
//        var2 = acx2.invoke("readData");
//        result2 = var2.getString();
//        System.out.println(result2);

        ActiveXComponent acx3 = new ActiveXComponent("UKEYINVOKER.UkeyInvokerCtrl.1");
        Dispatch dispatch3 = acx3.QueryInterface("{378855C3-C4B3-40FE-8A5F-6AE120402F95}");
        Variant var3 = Dispatch.call(dispatch3, 4);
        String result3 = var3.getString();
        System.out.println(result3);

        ActiveXComponent acx4 = new ActiveXComponent("UKEYINVOKER.UkeyInvokerCtrl.1");
        Dispatch dispatch4 = acx4.QueryInterface("{378855C3-C4B3-40FE-8A5F-6AE120402F95}");
        Variant var4 = Dispatch.call(dispatch4, "readData");
        String result4 = var4.getString();
        System.out.println(result4);

    }

}
